var http=require("http"),
var path=require("path"),
var fs=require("fs"),
mime=require("mime");

http.createServer((req,res)=>{
    var publicDir=path.join(__dirname,"public"),
    filename=path.join(publicDir,req.url);
    fs.readFile(filename,(err,data)=>{
        if (err) {
            res.end("not found 404");
        }else{
            res.setHeader("Content-Type",mime.getType(filename));
            
            res.end(data);
        }
    });
}).listen(5000,()=>{
    console.log("http://localhost:5000");
});